feat(migration): add type renaming to resolve native asset name conflicts#472
feat(migration): add type renaming to resolve native asset name conflicts#472MyvTsv wants to merge 3 commits intopluginsGLPI:mainfrom
Conversation
|
Does this apply to names that are too long? And CLI ? |
|
CLI compatibility would be a plus. |
|
At the time of renaming, it should also be ensured that the total length (PluginGenericObject + New name) does not exceed the maximum allowed size for MySQL table names. |
Rom1-B
left a comment
There was a problem hiding this comment.
It works.
Could you add a check that alerts if the table name exceeds 64 characters?
In the CLI, add at least one check and a message to prompt renaming in the interface.
Rom1-B
left a comment
There was a problem hiding this comment.
We also need to add the case where the Fields plugin adds fields
| if ($new_name === $old_name) { | ||
| return true; | ||
| } |
There was a problem hiding this comment.
It should be moved last. Cases that return false come before those that return true.
For example, if the name is too long, and the user enters the same name again, it returns true, but the name is still too long.
|
|
||
| $columns = $DB->request([ | ||
| 'SELECT' => ['TABLE_NAME'], | ||
| 'FROM' => 'information_schema.COLUMNS', |
There was a problem hiding this comment.
The SQL account you're using may not have access to information_schema. Instead, or in addition, you can use a query like this:
SHOW TABLES LIKE 'glpi\_plugin\_%';
SHOW COLUMNS FROM <table_name> WHERE Field = 'itemtypes';
Description
Screenshots (if appropriate):
Conflict:

Migrate
